#include "loghandler.h"
#include <gloox/loghandler.h>
#include <string>
#include <QtDebug>
#include <QString>

namespace Kajim
{
namespace XMPP
{

class LogHandler: public ::gloox::LogHandler
{
public:
    virtual void handleLog(::gloox::LogLevel level, ::gloox::LogArea area, const std::string &message)
    {
        qDebug() << QString::fromStdString(message);
    }
};

static Kajim::XMPP::LogHandler * inst = 0;

::gloox::LogHandler * getLogHandler()
{
    if (inst == 0) {
        inst = new LogHandler();
    }

    return inst;
}

}
}

